package mybatis.expand;

import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: landy
 * Date: 13-11-24
 * Time: 下午2:03
 * To change this template use File | Settings | File Templates.
 */
public class RenameDaoClassPlugin extends PluginAdapter {
    @Override
    public boolean validate(List<String> strings) {
        return true;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void initialized(IntrospectedTable introspectedTable) {
       // String oldName=introspectedTable.getDAOInterfaceType();
       String javaType= introspectedTable.getMyBatis3JavaMapperType();
       introspectedTable.setMyBatis3JavaMapperType(javaType.replace("Mapper","Dao"));
    }
}